package Other;

/**
 * @author:gao
 * @date:2020/7/13
 * @time:10:45
 * @version:0.0.1
 * @description:none
 */

public class MoveZeros {
}
//283. 移动零
class Solution {
    public void moveZeroes(int[] nums) {
        int p =0;
        for (int i = 0; i <nums.length ; i++) {
            if(nums[i]!=0){
                nums[p]=nums[i];
                p++;
            }
        }
        for (int i = p; i <nums.length ; i++) {
            nums[i]=0;
        }
    }
}
